package com.example.fill;

import android.os.Parcel;
import android.os.Parcelable;

public class Bean implements Parcelable {

    private int id;
    private String title;
    private String content;

    public int getId() {
        return id;
    }

    public Bean setId(int id) {
        this.id = id;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public Bean setTitle(String title) {
        this.title = title;
        return this;
    }

    public String getContent() {
        return content;
    }

    public Bean setContent(String content) {
        this.content = content;
        return this;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.title);
        dest.writeString(this.content);
    }

    public void readFromParcel(Parcel source) {
        this.id = source.readInt();
        this.title = source.readString();
        this.content = source.readString();
    }

    public Bean() {
    }

    public Bean(int id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }

    protected Bean(Parcel in) {
        this.id = in.readInt();
        this.title = in.readString();
        this.content = in.readString();
    }

    public static final Parcelable.Creator<Bean> CREATOR = new Parcelable.Creator<Bean>() {
        @Override
        public Bean createFromParcel(Parcel source) {
            return new Bean(source);
        }

        @Override
        public Bean[] newArray(int size) {
            return new Bean[size];
        }
    };
}
